package com.mxpio.erp.common.plm.entity;

import com.mxpioframework.jpa.annotation.DictAble;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
@Data
@Schema(description = "统计报表")
public class ProjectReport implements DictAble,Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "项目总数")
    private Integer projectTotal;

    /**项目类型*/
//    @Column(name = "PRO_TYPE_")
    @Schema(description = "项目类型")
    @Dict(dicCode = "ERP_PROJECT_INFO_PRO_TYPE")
    private String proType;

    @Schema(description = "所属项目类型总数")
    private Integer proTypeNum;

    @Schema(description = "新增数量")
    private Integer newNum;

    @Schema(description = "已完成数量")
    private Integer completionNum;

    @Schema(description = "逾期完成数量")
    private Integer overdueCompletionNum;

    @Schema(description = "执行中数量")
    private Integer executeNum;

    @Schema(description = "逾期执行数量")
    private Integer overdueExecuteNum;

    @Schema(description = "已暂停数量")
    private Integer pauseNum;

    @Schema(description = "已终止数量")
    private Integer endNum;

    @Schema(description = "已完成数量")
    private Integer completeNum;

    @Schema(description = "未完成数量")
    private Integer incompleteNum;

    /**
     * 完成任务数量
     */
    @Schema(description = "任务负责人")
    @Dict(dicCode = "username", dicEntity = User.class, dicText = "nickname")
    private String taskHead;

    @Schema(description = "任务完成数量")
    private Integer taskNum;

    @Transient
    private Map<String, String> textMap;

    public String putText(String key, String value) {
        if (textMap == null) {
            textMap = new HashMap<>();
        }
        return textMap.put(key, value);
    }

}
